# -*- coding: utf-8 -*-


import argparse
from yyets import VideoFormat, WayFormat


def parse_cli_args():
    parser = argparse.ArgumentParser(description="parse yyets resource file")
    parser.add_argument(
        "-f",
        "--file",
        required=True,
        help="a yyets reource file",
    )
    parser.add_argument(
        "-vf",
        "--format",
        required=True,
        type=VideoFormat,
        help="video format, eg:"
        + ",".join([x.value for x in VideoFormat if x != VideoFormat.V_IDONTCARE]),
    )
    parser.add_argument(
        "-s",
        "--season",
        default=0,  # all
        type=int,
        help="which season do you want",
    )
    parser.add_argument(
        "-e",
        "--episode",
        default=0,  # all
        type=int,
        help="which episode do you want",
    )
    parser.add_argument(
        "-o",
        "--output",
        help="write result to file",
    )
    parser.add_argument(
        "-i",
        "--info",
        action="store_false",
        help="only return resource data",
    )
    parser.add_argument(
        "-w",
        "--way",
        help="downloan link format, eg:"
        + ",".join([x.value for x in WayFormat if x != WayFormat.W_IDONTCARE]),
    )

    return parser.parse_args()
